package com.suxin.ratelimit.v2.exception;

import com.suxin.core.domain.Response;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author Tang
 * @classname LimitRestExceptionHandler
 * @description [  ]
 * @date 2022/2/10 14:39
 */
@RestControllerAdvice
public class LimitRestExceptionHandler {

    @ExceptionHandler({LimitRestException.class})
    public Response exceptionHandler(Exception e) {
        return Response.create().fail(e.getMessage());
    }

}